Probability intro.md (2510B)
1 +++ 2 title = 'Probability intro' 3 template = 'page-math.html' 4 +++ 5 6 # Probability intro 7 8 sample space: set of all possible outcomes 9 - Ω = 1,2,3,4,5,6 10 11 event: collection of outcomes (capital letters) 12 - A = {even number thrown} = {2,4,6} 13 14 probability measure: value between 0 and 1 15 - $P(A) = P(2,4,6 = \frac{1}{2})$ 16 - P(A) = 0: event is impossible 17 - P(A) = 1: event is certain 18 19 ## Determining probability 20 21 1. Estimate with relative frequency: 22 $\begin{aligned} 23 P(A) &= \frac{\text{number of occurrences of A}}{\text{number of times procedure was repeated}} \\\\ 24 &= \frac{\text{successes}}{\text{total number of tries}} 25 \end{aligned}$ 26 27 2. Theoretical approach: make a probability model 28 3. Subjective approach: estimate P(A) based on intuition/experience 29 30 Finding P(A) for discrete case: 31 1. Find sample space Ω 32 33 2. Determine probabilities P(ω) for all ω ∈ Ω 34 35 - if all equally likely, then P(ω) = 1/N where N is number of outcomes in Ω 36 37 3. Determine which outcomes are in A 38 4. Compute P(A) by 39 40 $P(A) = \sum_{\omega :\; \omega \in A} P(\omega)$ 41 42 ## Probability rules: 43 44 “At least one”: P(at least one) = 1 - P(none) 45 46 Addition rule (A and B): $P(A \cup B) = P(A) + P(B) - P(A \cap B)$ 47 48 Complement (not A): 49 - $P(\bar{A}) = 1 - P(A)$ 50 - $P(A) = P(B \cap A) + P(\bar{B} \cap A)$ 51 52 Conditional probability (B given A): 53 - $P(B | A) = \frac{P(A \cap B)}{P(A)}$ 54 - $P(A \cap B) = P(A | B) \times P(B)$ 55 - $P(B) + = P(B | \bar{A}) \times \bar{A}$ 56 - $P(B | A) + P(\bar{B} | A) = 1$ (**NOT IF COMPLEMENT IS IN CONDITION**) 57 58 Disjoint events (mutually exclusive): 59 - $P(A \cup B) = P(A) + P(B)$ 60 - $P (A \cap B) = 0$ 61 62 Independent events: 63 - $P(A \cap B) = P(A) \times P(B)$ 64 - $P(B|A) = P(B)$ 65 66 ## Bayes theorem 67 68 Forget that complicated-ass formula. You literally never need to use it. 69 For example, given these values: 70 - P(A) = 0.01 71 - $P(\bar{A})$ = 0.99 72 - $P(X|A)$ = 0.9 73 - $P(X|\bar{A})$ = 0.08 74 75 You need to calculate $P(A|X)$. Use conditional probability and do some rewriting: 76 77 $\begin{aligned} 78 P(A|X) &= \frac{P(A \cap X)}{P(X)}\\\\ 79 P(X) &= P(A \cap X) + P(\bar{A} \cap X)\\\\ 80 \therefore P(A|X) &= \frac{P(A \cap X)}{P(A \cap X) + P(\bar{A} \cap X)} \\\\ 81 P(A \cap X) &= P(X \cap A) \\\\ 82 &= P(X|A) \times P(A) \\\\ 83 \therefore P(A|X) &= \frac{P(X|A) \times P(A)}{P(X|A) \times P(A) + P(X|\bar{A}) \times P(\bar{A})} \\\\ 84 &= \frac{0.9 \times 0.01}{0.9 \times 0.01 + 0.08 \times 0.99} \\\\ 85 &= 0.1020408163 \approx 0.1 86 \end{aligned}$ 87